package com.spring.sunflower.conversation;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.spring.sunflower.R;
import com.spring.sunflower.base.BaseCompatFragment;
import com.spring.sunflower.bottompanel.EmotionUtils;
import com.spring.sunflower.bottompanel.FragmentFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Kevin on 2021/6/14<br/>
 * <p>
 * Describe:<br/>
 */
public class EmotionFragment extends BaseCompatFragment {
    private RecyclerView mRecyclerView;
    private int emotionType;
    private List<String> emotionNames = new ArrayList<>();
    private EmotionAdapter mAdapter;

    @Override
    public int setLayoutResId() {
        return R.layout.fragment_emotion;
    }

    @Override
    public void initView() {
        mRecyclerView = mView.findViewById(R.id.rvRecyclerView);
        GridLayoutManager layoutManager = new GridLayoutManager(mActivity, 7);
        mRecyclerView.setLayoutManager(layoutManager);
        emotionType = args.getInt(FragmentFactory.EMOTION_MAP_TYPE);
        for (String emojiName : EmotionUtils.getEmojiMap(emotionType).keySet()) {
            emotionNames.add(emojiName);
        }
        mAdapter = new EmotionAdapter(R.layout.adapter_message_emotion, emotionNames,emotionType);
        mRecyclerView.setAdapter(mAdapter);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {

    }

    @Override
    public void loadData() {

    }
}
